<?php 
$this->load->view('components/header'); 
$form_action = ( !empty( $agent_id ) ? base_url() . 'agent/edit/' : base_url() . 'agent/add/' );
?>

	<img id="top" src="<?php echo base_url();?>images/top.png" alt="">
	<div id="form_container">
		<h1><a>Agent Maintenance</a></h1>
		<form id="form_169164" class="appnitro"  method="post" action="<?php echo $form_action;?>">
         <?php if( !empty( $agent_id ) ){ echo "<input type=\"hidden\" value=\"{$agent_id}\" name=\"id\"  />"; }?>
			<div class="form_description">
				<h2>Agent Maintenance</h2>
				<p>Kingglobaltrading Sales Agents</p>
			</div>		
         
         <?php if( validation_errors() ){ ?>
            <div id="error_message"><?php echo  validation_errors(); ?></div>      
         <?php } ?>		
         
         <?php if( isset( $system_message ) && !validation_errors() ){ ?>
            <div id="error_message"><?php echo $system_message; ?></div>      
         <?php } ?>
			<ul>
				<li>
					<label class="description" for="element_1">Agent Name </label>
					<div>
						<input class="element text medium" name="agentname" type="text" maxlength="255" value="<?php echo (isset($agent_name)? $agent_name : ''); ?>"/>
					</div> 
				</li>		
				<li>
					<label class="description" for="element_2">Alias </label>
					<div>
						<input class="element text medium" name="alias" type="text" maxlength="255" value="<?php echo (isset($alias)? $alias : ''); ?>"/> 
					</div> 
				</li>
				<li class="buttons">
					<input id="saveForm" class="button_text" type="submit" name="submit" value="Save" />
				</li>
			</ul>
		</form>
	</div>
	<img id="bottom" src="<?php echo base_url();?>images/bottom.png" alt="">
<?php $this->load->view('components/footer'); ?>
